<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> 
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>

<p id="msg"></p>
<fieldset>
<label><bean:message key="EditGift.label"/> </label>

<html:form method="post" styleClass="control" action="/EditGift.do?id=${requestScope.gift.id}" enctype="multipart/form-data">
<table>
	<tr><td></td><td> <html:errors property="name" /></td></tr>
    <tr>
        <td>
        <label><bean:message key="EditGiftForm.name"/></label>
        </td>
        <td><html:text styleClass="textfieldadmin" property="name" /></td>
    </tr>
    <tr><td></td><td> <html:errors property="descrizione" /></td></tr>
    <tr>
    	<td>
    	<label><bean:message key="EditGiftForm.description"/></label>
    	</td>
    	<td><html:textarea styleClass="textfieldadmin"
				property="descrizione"  style="width:100%"/></td>
    </tr>
    <tr><td></td><td> <html:errors property="link" /></td></tr>
        <tr>
    	<td>
    	<label><bean:message key="EditGiftForm.link"/></label>
    	</td>
    	<td><html:text
				styleClass="textfieldadmin" property="link"  /></td>
    </tr>
    <tr><td></td><td> <html:errors property="linkname" /></td></tr>
    <tr>
    	<td>
    	<label><bean:message key="EditGiftForm.linkname"/></label>
    	</td>
    	<td><html:text styleClass="textfieldadmin" property="linkname"/></td>
    </tr> 
    <tr><td></td><td> <html:errors property="price" /></td></tr>
    <tr>
    	<td>
    	<label><bean:message key="EditGiftForm.price"/></label>
    	</td>
    	<td><html:text
				styleClass="textfieldadmin" property="price"  /></td>
   </tr>
   <tr><td></td><td> <html:errors property="price" /></td></tr>
   <tr>
		<td><label> <bean:message key="EditGiftForm.category"/> </label></td>
		<td>
			<html:select styleClass="textfieldadmin"  property="categoryList" >
				<!--<html:option  value="${requestScope.gift.category.id}">${requestScope.gift.category.name}</html:option>-->
				<c:forEach var = "categoryListElement" items = "${requestScope.categoryList}">
					<html:option  value="${categoryListElement.id}">${categoryListElement.name}</html:option>
				</c:forEach>
			</html:select>		
		</td>
		</tr>
   
    <tr>
      	<td><label><bean:message key="EditGiftForm.uploadedfile"/> </label></td>
      	<td>
			<html:file property="uploadedfile" /> 
			<html:img page="/ShowFile.do?id=${requestScope.gift.id}" width="50" height="60"/>
			
		
      	</td>
      
      	
      </tr>
        <tr>
        <td></td>
    	<td>
    	<html:submit styleClass="control" value="Save" />
    	</td>
    </tr>
</table>
</html:form>
</fieldset>
